Efficient way to insert data into a sorted vector